package com.honey.mybatis.generator.entity;

import com.honey.core.dbmapping.introspect.IntrospectSchema;
import com.honey.core.dbmapping.introspect.IntrospectSchemaColumn;
import com.honey.core.types.FullyQualifiedJavaType;
import com.honey.core.types.JDKFullyQualifiedJavaType;
import com.honey.mybatis.generator.AbstractClass;
import com.honey.mybatis.generator.MybatisPlugin;

public class EntityClass extends AbstractClass {
	
	public EntityClass(MybatisPlugin belongPlugin,
			IntrospectSchema introspectSchema,
			IntrospectSchemaColumn introspectSchemaColumn) {
		super(belongPlugin, introspectSchema, introspectSchemaColumn);
	}

	@Override
	protected FullyQualifiedJavaType getType() {
		return super.getEntityPrimitiveClassType(introspectSchema.getSchema());
	}

	@Override
	protected FullyQualifiedJavaType[] getImplements() {
		return new FullyQualifiedJavaType[]{
				mybatisPlugin.isEntitySerializable()?JDKFullyQualifiedJavaType.getSerializableInstance():null,
				super.getEntityInterfaceType(null),
		};
	}
}
